<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2024-06-03
  Time: 19:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>circle</title>
</head>
<body>
<%!
    public String circleArea(double r) {
        return String.format("%.2f", 3.1415926535 * (r * r));
    }
%>
<%
    Double r = 0.0d;
    try {
        r = Double.valueOf(request.getParameter("r"));
    } catch (Exception e) {
        e.printStackTrace();
    }

%>
<h1 class="active">
    半径为${param.r}的圆形面积是：<%out.print(circleArea(r));%>。
</h1>
</body>
</html>
